home *** CD-ROM | disk | FTP | other *** search
- /*
- * $RCSfile: initializeMsg.c,v $
- * $Revision: 1.1.1.1 $
- * $Date: 1996/05/04 21:55:54 $
- */
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
- #include "sysdefs.h"
- #include "ess.h"
- #include "checking.h"
- #include "trace.h"
- #include "error.h"
- #include "list.h"
- #include "tid.h"
- #include "io.h"
- #include "lock.h"
- #include "object.h"
- #include "msgdefs.h"
- #include "thread.h"
- #include "semaphore.h"
- #include "adminmsg.h"
- #include "link.h"
- #include "host.h"
- #include "bitvec.h"
- #include "msgvector.h"
- #include "msg_funcs.h"
- #include "util_funcs.h"
- #include "msg_globals.h"
- #include "volume.h"
- #include "disk_globals.h"
- #include "sharedmem_globals.h"
- #include "queue_globals.h"
- #include "queue_consist.h"
- #include "server_util_funcs.h"
-
- void
- initializeMsg (
- int initConnect
- )
- {
-
- register int i;
-
-
- TRACE(TR_MSG, TR_LEVEL_1);
-
- /*
- * signal handling
- */
- #ifdef __cplusplus
- /* gcc typedefs SignalHandler instead of SIG_PF */
- # if defined(__GNUC__) && !defined(SIG_PF)
- # define SIG_PF SignalHandler
- # endif
- # ifdef hpux
- signal(SIGPIPE, (void (*)(int)) pipeError);
- # else
- signal(SIGPIPE, (SIG_PF) pipeError);
- # endif hpux
- #elif defined(mips)
- signal(SIGPIPE, (PFI) pipeError);
- #else
- /* bug in cpp includes everything listed here */
- #endif
-
- /*
- * initilize the bit vectors
- */
- for (i = 0; i < BVL; i++) {
-
- SelectMask.bv_data[i] = 0;
- DiskMask.bv_data[i] = 0;
- AllMask.bv_data[i] = 0;
- }
-
- /*
- * initialize the Links
- */
- initializeLinks();
-
- /*
- * set initial receive conditions
- */
- SelectRestrict = FALSE;
-
- /*
- * initialize the message bufs
- */
- SM_ASSERT(LEVEL_1, (ShmDiskMessages!=NULL));
- DiskMessages = (DISKMSG *)(ShmDiskMessages);
-
- /*
- * create the initial connection
- */
- if (initConnect) {
-
- connectInitialize();
-
- }
-
- }
-
- void
- initializeStdin()
- {
- /*
- * Set up link for standard input
- */
- SM_ASSERT(LEVEL_1, (fileno(stdin) != -1));
- Links[fileno(stdin)].linkClass = CL_STDIN;
- setLink(&(Links[fileno(stdin)]));
-
- if(isatty(fileno(stdin))) {
- startuptty();
- }
- }
-